package com.campus.commons.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="CheckClass对象", description="查班表")
@TableName(excludeProperty={"classRoomName","className","studentName","page","limit","classCount",})


public class CheckClass implements Serializable {

    public static String[] filter = {"class_room_name", "class_name", "student_name"};
    private String classRoomName;
    private String className;
    private String studentName;
    private Integer page;
    private Integer limit;

    public void setClassroomid(Integer classroomid) {
        this.classRoomName = ClassRoom.classrooms.get(classroomid);
        this.classroomid = classroomid;
    }

    public void setClassid(Integer classid) {
        Class aClass = Class.classes.get(classid);
        this.classCount = aClass.getClassCount();
        this.className = aClass.getClassname();
        this.classid = classid;
    }

    public void setStudentid(Integer studentid) {
        this.studentName = Student.students.get(studentid).getStuname();
        this.studentid = studentid;
    }

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "1:上午  2:下午")
    @TableField("isTop")
    private Integer istop;

    @ApiModelProperty(value = "日期")
    private Date date;

    @ApiModelProperty(value = "查的教室")
    @TableField("classRoomId")
    private Integer classroomid;

    @ApiModelProperty(value = "查的班级")
    @TableField("classId")
    private Integer classid;

    @ApiModelProperty(value = "应到人数")
    private Integer classCount;

    @ApiModelProperty(value = "实到人数")
    @TableField("factPerson")
    private Integer factPersons;

    @ApiModelProperty(value = "出勤率")
    private String work;

    @ApiModelProperty(value = "正装数")
    @TableField("formalSuit")
    private Integer formalsuit;

    @ApiModelProperty(value = "正装率")
    @TableField("formalWork")
    private String formalwork;

    @ApiModelProperty(value = "值班人员")
    @TableField("studentId")
    private Integer studentid;


}
